package com.cq.mapper;

import com.cq.pojo.Topic;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: 悠久的苍穹
 * @Date: 2021/2/2 14:58
 * @Description: ${description}
 * @Version: 1.0
 */
@Mapper
@Repository
public interface TopicMapper {
    int addTopic(Topic topic);

    List<Topic> getTopics(@Param("page") int page, @Param("limit") int limit);

    int getCount();

    int getTopicCount(@Param("start") String start, @Param("end") String end);

    List<Topic> getTopicsByTime(@Param("page") int page, @Param("limit") int limit, @Param("start") String start, @Param("end") String end);

    List<Topic> getTopicAndReply();


    void deleteTopicById(@Param("id") int id);

    Topic getTopicById(@Param("id") int id);

    void updateTopicHot(@Param("id") int id);

    void updateTopicCold(@Param("id") int id);

    List<Topic> getHotTopics();

    Topic getTopicAndReplyById(@Param("id") int id);

    List<Topic> getTopicAndReplyByCreate(@Param("nickName") String nickName);
}
